import Promise from "./promise";

let promise = new Promise((resolve, reject) => {
  setTimeout(() => {
    resolve("成功");
  }, 5);
});

promise
  .then(
    (resolveData) => {
      console.log("第一个then成功了:", resolveData);
      return "ok1";
    },
    (rejectData) => {
      console.log("第一个then失败了:", rejectData);
      return "fail1";
    }
  )
  .then(
    (resolveData) => {
      console.log("第二个then成功了:", resolveData);
      return "ok2";
    },
    (rejectData) => {
      console.log("第二个then失败了:", rejectData);
      return "fail2";
    }
  )
  .then(
    (resolveData) => {
      console.log("第二个then成功了:", resolveData);
      return "ok3";
    },
    (rejectData) => {
      console.log("第二个then失败了:", rejectData);
      return "fail3";
    }
  );

export {};
